# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-http-request-common
_pkgname=HTTP-Message
pkgver=6.32
pkgrel=3
pkgdesc='Construct common HTTP::Request objects'
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
url='http://search.cpan.org/~gaas/HTTP-Message-6.06/lib/HTTP/Request/Common.pm'
source=("http://search.cpan.org/CPAN/authors/id/O/OA/OALDERS/$_pkgname-$pkgver.tar.gz")
sha512sums=('359a0d51e65d721d8167dea05d7aa9853d07eb4a4093735cf5f45814117070400cce93d60b08dcf92cfe0fbc98e7455e7facaecbfcaff44cc0e619fb621b3288')

prepare() {
  cd "$_pkgname-$pkgver"

  export PERL_MM_USE_DEFAULT=1 PERL5LIB="" \
    PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

  /usr/bin/perl Makefile.PL
}

build() {
  cd "$_pkgname-$pkgver"

  make
}

package() {
  cd "$_pkgname-$pkgver"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

